Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow url field to accept class attribute #810

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LC43
Copy link

@LC43 LC43 commented Aug 25, 2019

this will allow devs to assign classes to specific elements in the admin edit screens.

then just

array(
	'label'       => esc_html__( 'URL', 'cake ),
	'attr'        => 'url-1',
	'type'        => 'url',
	'class'       => 'cake_main_url-1',
	'description' => esc_html__( 'Link to open when button is clicked', 'cake' ),
),

this will allow devs to assign classes to specific elements in the admin edit screens.
@goldenapples
Copy link
Contributor

I can see how this might be helpful.

The only suggestion I have to use some escaping around the class name, so that we have a bit of protection against broken markup or xss. Changing this from {{{data.class}}} to {{ data.class }} would use underscore's escaping and prevent quotes passed in this parameter from breaking the output markup. If you make that change, I'd be 👍for merging it.

@LC43
Copy link
Author

LC43 commented Aug 26, 2019

hi @goldenapples , thanks for the suggestion!

I've changed the PR accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants